import request from '@/utils/request'

// 获取运动员列表
export function getTeamotherList(params) {
  if(params) {
    return request({
      url: `/work/teamother/list?page=${params.pageNum}&rowsPerPage=${params.pageSize}`,
      method: 'get'
    })
  } else {
    return request({
      url: `/work/teamother/list`,
      method: 'get'
    })
  }
}

// 新增运动员
export function insert(data) {
  return request({
    url: '/work/teamother/saveOrUpdate',
    method: 'post',
    data:data
  })
}

export function update(data) {
  return request({
    url: '/work/teamother/saveOrUpdate',
    method: 'post',
    data:data
  })
}

// 删除运动员
export function batchDelete(params) {
  return request({
    url: '/work/teamother/delete-by-ids',
    method: 'get',
    params:params
  })
}
// 获取运动员信息
export function getById(params) {
  return request({
    url: '/work/teamother/' + params.id,
    method: 'get'
  })
}